<!DOCTYPE html>
<html class="has-topbar has-bottombar">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
		<link rel="shortcut icon" href="../../img/icon/bitbug_favicon.ico">
		<link rel="stylesheet" href="../../css/mui/mui.min.css" />
		<link rel="stylesheet" href="../../css/myAlert.css" />

		<title>工资卡管理</title>
		<style>
			html,
			body {
				background: #F2F2F2 !important;
			}
			
			.mui_aetd {
				width: 100%;
				height: 50px;
				background: #FFFFFF;
				position: fixed;
				top: 0px;
				z-index: 888;
				border-bottom: solid 1px #F1F1F1;
			}
			
			.aeta_b {
				width: 100%;
				height: 100%;
				float: left;
			}
			
			.aeta_b img {
				width: 10px;
				height: 15px;
				display: block;
				margin-top: 0.44rem;
				float: left;
				margin-top: 17.5px;
			}
			
			.qy_detas {
				text-align: center;
				color: #1B1B1B;
				font-size: 1.2rem;
				line-height: 50px;
			}
			
			.a_ton {
				margin-top: 70px;
			}
			
			.personal_zhmoney .zh_mey .mey_right {
				width: auto;
				height: 100%;
				float: right;
			}
			
			.right {
				width: 100%;
				height: 60px;
				float: right;
				line-height: 60px;
				font-size: 16px;
				border-bottom: 1px solid #EEEEEE;
				background: #FFFFFF;
			}
			
			.mians {
				float: left;
				margin-left: 5%;
			}
			
			.right img {
				width: 15px;
				height: 20px;
				float: right;
				margin-top: 20px;
				margin-right: 6%;
			}
			
			.bgk_zzc {
				display: none;
				width: 100%;
				height: 100%;
				position: fixed;
				background: rgba(0, 0, 0, 0.6);
				top: 0px;
				left: 0px;
				right: 0px;
				z-index: 777;
			}
			
			.gzk_mod {
				display: none;
				width: 70%;
				height: 180px;
				background: #FFFFFF;
				position: fixed;
				z-index: 777;
				left: 15%;
				border-radius: 8px;
				top: 35%;
			}
			
			.gzk_mod .cf_bag {
				width: 100%;
				height: 6px;
				background: #3CAFFF;
				border-radius: 8px 8px 0px 0px;
			}
			
			.gzk_mod .mod_two {
				text-align: center;
				color: #1B1B1B;
				font-size: 16px;
				margin-top: 50px;
			}
			
			.gzk_mod .mod_btn {
				width: 100%;
				height: 50px;
				background: #3CAFFF;
				color: #FFFFFF;
				font-size: 18px;
				text-align: center;
				line-height: 50px;
				position: absolute;
				bottom: 0px;
				border-radius: 0px 0px 8px 8px;
			}
		</style>
	</head>

	<body>
		<div class="mui_aetd">
			<div class="aeta_b">
				<a id="card-back" href="javascript:;" class="mui-icon mui-icon-left-nav mui-pull-left" style="color: #6D6D72;margin-left: 2%;font-size: 1.5rem;line-height: 3rem;"></a>
				<div class="qy_detas">工资卡管理</div>
			</div>
		</div>
		<div class="a_ton">
			<div class="right" id="bindCard">
				<div class="mians">工资卡绑定</div>
				<img src="../../img/personal/personalha_08.png">
			</div>
			<div class="right" id="updateWithdrawPwd">
				<div class="mians">修改提现密码</div>
				<img src="../../img/personal/personalha_08.png">
			</div>
		</div>
		<div class="bgk_zzc"></div>
		<div class="gzk_mod">
			<div class="cf_bag"></div>
			<div class="mod_two">请先进行工资卡绑定</div>
			<div class="mod_btn">确定</div>
		</div>
		<div style="position: fixed;display:table;margin: 0 auto;width: 0px;height: 0px;;top: 45%;left: 50%;right: 50%;">
			<div id="myspin"></div>
		</div>
	</body>

	<script type="text/javascript" src="../../js/mui/mui.min.js"></script>
	<script type="text/javascript" src="../../js/jquery/jquery-2.1.4.min.js"></script>
	<script type="text/javascript" src="../../js/spin/spin.min.js"></script>
	<script type="text/javascript" src="../../js/myAlert.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../server.js"></script>
	<script type="text/javascript" src="../../js/util/util.js"></script>
	<script type="text/javascript">
		if(isiOS) {
			$(".mui_aetd").css("display", "none");
			$(".a_ton").css("margin-top", "20px");
		}

		var spinner = new Spinner(opts);
		var userid_sign = sessionStorage.getItem("userid_sign");
		if(!userid_sign) {
			userid_sign = sessionStorage.getItem("openid");
		}

		//工资卡绑定
		$("#bindCard").click(function() {
			backLogin(userid_sign, "../../login.html", function() {
				var param = {};
				param.userid_sign = userid_sign;
				//查询工资卡信息
				queryIsBindCard(param, function(resultObj) {
					if(resultObj.data != null) {
						var bankObj = resultObj.data;
						if(bankObj.bankNumber != "" && bankObj.bankNumber != null) {
							var regPhone = bankObj.phone; //系统手机号-账号
							sessionStorage.setItem("reg_phone", regPhone);
							sessionStorage.setItem("bank_user_name", bankObj.userName);
							sessionStorage.setItem("identity_no", bankObj.identityNo);
							sessionStorage.setItem("card_no", bankObj.bankNumber);
							sessionStorage.setItem("reserved_phone", bankObj.bankUserTel);
							//换绑
							window.location.href = "paycardbinding_asce.html";
						} else {
							sessionStorage.setItem("bank_user_name", bankObj.userName);
							sessionStorage.setItem("identity_no", bankObj.identityNo);
							window.location.href = "paycardbinding.html";
						}
					} else { //绑定工资卡
						window.location.href = "paycardbinding.html";
					}
				})
			})
		})

		//修改提现密码
		$("#updateWithdrawPwd").click(function() {
			backLogin(userid_sign, "../../login.html", function() {
				var param = {};
				param.userid_sign = userid_sign;
				//查询工资卡信息
				queryIsBindCard(param, function(resultObj) {
					if(resultObj.data != null) {
						var bankObj = resultObj.data;
						if(bankObj.bankNumber != "" && bankObj.bankNumber != null) {
							var regPhone = bankObj.phone; //系统手机号-账号
							sessionStorage.setItem("reg_phone", regPhone);
							window.location.href = "withdrawpwd_update.html";
						} else {
							$(".bgk_zzc").show();
							$(".gzk_mod").show();
						}
					} else { //提示先绑定工资卡
						$(".bgk_zzc").show();
						$(".gzk_mod").show();
					}
				})
			})
		})

		//提示框
		$(".mod_btn").click(function() {
			$(".bgk_zzc").hide();
			$(".gzk_mod").hide();
		})

		/**
		 * 工资卡管理返回
		 */
		$("#card-back").click(function() {
			if(sessionStorage.getItem("wallet_sign") == 001166) {
				window.location.href = "../../wallet.html";
			} else {
				window.location.href = "../../app/personal/personal.html";
			}
		})
	</script>

</html>